import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import {JVxeTypes,JVxeColumn} from '/@/components/jeecg/JVxeTable/types'
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '工作内容',
    align:"center",
    dataIndex: 'gongzuoneirong'
   },
   {
    title: '质量要求',
    align:"center",
    dataIndex: 'zhiliangyaoqiu'
   },
   {
    title: '下次汇报时间',
    align:"center",
    dataIndex: 'xiacihuibaoshijian'
   },
    {
        title: '配合部门',
        align:"center",
        dataIndex: 'peihebumen'
    },
    {
        title: '驳回情况',
        align:"center",
        dataIndex: 'bohuiqingkuang'
    },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '工作内容',
    field: 'gongzuoneirong',
    component: 'InputTextArea',
  },
  {
    label: '质量要求',
    field: 'zhiliangyaoqiu',
    component: 'InputTextArea',
  },
  {
    label: '周期',
    field: 'zhouqi',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"zhouqi"
     },
  },
  {
    label: '数量',
    field: 'shuliang',
    component: 'InputNumber',
  },
  {
    label: '下次汇报时间',
    field: 'xiacihuibaoshijian',
    component: 'DatePicker',
    componentProps: {
       showTime:true,
       valueFormat: 'YYYY-MM-DD HH:mm:ss'
     },
  },
  {
    label: '是否生效',
    field: 'shifoushengxiao',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"shifoushengxiao"
     },
  },
  {
    label: '责任主管',
    field: 'zerenzhuguanid',
    component: 'JSelectMultiple',
    componentProps:{
        dictCode:""
     },
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];
//子表单数据
//子表表格配置
export const yPeihebumenbiaoColumns: JVxeColumn[] = [
    {
      title: '配合部门',
      key: 'peihebumenid',
      type: JVxeTypes.selectMultiple,
      options:[],
      dictCode:"",
      width:"250px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '协作内容',
      key: 'xiezuoneirong',
      type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '质量要求',
      key: 'zhiliangyaoqiu',
      type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
  ]


// 高级查询数据
export const superQuerySchema = {
  gongzuoneirong: {title: '工作内容',order: 0,view: 'textarea', type: 'string',},
  zhiliangyaoqiu: {title: '质量要求',order: 1,view: 'textarea', type: 'string',},
  xiacihuibaoshijian: {title: '下次汇报时间',order: 4,view: 'datetime', type: 'string',},
  //子表高级查询
  yPeihebumenbiao: {
    title: '配合部门',
    view: 'table',
    fields: {
        peihebumenid: {title: '配合部门',order: 0,view: 'list_multi', type: 'string',dictCode: '',},
        xiezuoneirong: {title: '协作内容',order: 1,view: 'text', type: 'string',},
        zhiliangyaoqiu: {title: '质量要求',order: 2,view: 'text', type: 'string',},
    }
  },
};

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
// 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}